cc.Class({
    extends: cc.Component,
    properties: {
        rankingScrollView: cc.Sprite,
    },
    onLoad() {
    },
    start() {
            this.submitScoreButtonFunc();
            this.RefreshButtonFunc();  
    },

    RefreshButtonFunc() {
            window.wx.postMessage({
                messageType: 1,
                KEY: "x1"
            });
            console.log("send refresh command");
    },

    submitScoreButtonFunc() {
        let score = window.highestScore;
            window.wx.postMessage({
                messageType: 2,
                KEY: "x1",
                score: score,
            });
            console.log("submit score: " + score)
    },

    writeZero() {                      //debug用，把自己清空
        let score = 0;
            window.wx.postMessage({
                messageType: 3,
                KEY: "x1",
                score: score,
            });
            cc.log("submit score: " + score)
    }
});
